#pragma once 
#include "tinyrpc/base/task.h"
#include "tinyrpc/base/timestamp.h"
namespace TinyRPC {
class Timer{

public:
    Timer(const TimeStamp& startTime, const TimeStamp& interval, const Task& task);
    void runTask();
    bool isPeriod();
    void nextPeriod();

    bool operator<(const Timer &) const;
    bool operator==(const Timer &) const;
    bool operator>(const Timer &) const;
    TimeStamp getStartTime() const{ return m_startTime;}
private:
    TimeStamp m_startTime;
    TimeStamp m_interval;
    Task m_task;
};
}
